//src/store/index.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex);
export default new Vuex.Store({
    state:{
        num1:0,
        num2:0,
        num3:0
    },
    mutations:{
        ADD1(state) {
            state.num1 ++
        },
        REDUCE1(state) {
            state.num1 --
        },
        ADD2(state) {
            state.num2 ++
        },
        REDUCE2(state) {
            state.num2 --
        },
        ADD3(state) {
            state.num3 ++
        },
        REDUCE3(state) {
            state.num3 --  
        },
    },
    actions:{},
    getters:{
        totalSum(state) {
            return state.num1*1000+state.num2*2000+state.num3*200
        }
    }
 
});
